﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Kiiro.Common.Utility;
using Kiiro.SiteDefinition.Core;

namespace Kiiro.SiteDefinition.ControlTemplates
{
    public abstract class KiiroUserControl : System.Web.UI.UserControl
    {
        private BasePage basePage;
        public BasePage Base { get { return basePage; } }

        public bool IsPortal { get; set; }
        public bool IsProject { get; set; }

        protected override void OnInit ( EventArgs e )
        {         
            basePage = Page is BasePage ? ( BasePage ) Page : new BasePage ( ).DefaultBasePage;
            
            IsPortal = SPHelpers.IsPortal ( Base.SiteCollectionId, Base.ServerRelativeUrl );
            IsProject = SPHelpers.IsProject ( Base.SiteCollectionId, Base.ServerRelativeUrl );

            base.OnInit ( e );
        }
    }
}

/*************************************************************************
 * 
 * $Log: /Internal Projects/Kiiro/Kiiro.SiteDefinition/12/TEMPLATE/CONTROLTEMPLATES/Kiiro/KiiroUserControl.cs $
 * 
 * 2     1/06/10 12:39p Camerons
 * 
 * 1     12/18/09 11:26a Camerons
 * 
 ************************************************************************/
